#!/bin/bash

for k in 1 3 5 10 15 20 
do
    files=$(ls ${1}/k${k}/)
    for file in $files 
    do
        input="${1}/k${k}/${file}"
    
        time1=$(date)
        echo ""	
        echo ${time1}

        lb=`grep "^c pre_LB " $input | cut -d ' ' -f 3`
        k=`grep "^c k " $input | cut -d ' ' -f 3`
        
	echo "timeout 12000 ../../KDefective -r ${input} -O solve -a MADEC -D Set -k ${k} -M ${lb} -t 10800"

        if [ -z "$lb" -a -z "$k" ] 
        then
            echo "prework wrong !!!"
        else 
            timeout 12000 ../../KDefective -r ${input} -O solve -a MADEC -D Set -k ${k} -M ${lb} -t 10800
        fi
    done
done

